clear all
set mem 50m
set more off

insheet using "/Users/gwf25/Dropbox/research/religion/final code/cornell_identity.txt"


************************************************************************************
***treatment indicator should be the same across RAs
rename religiontreatmentorcontroltc treatR
tab treatR
drop if treatR == "NA"
replace treatR = "T" if treatR == "R"
tab treatR 
************************************************************************************

************************************************************************************

************************************************************************************


************************************************************************************

************************************************************************************






************************************************************************************
***make all identity categories lowercase
*iunique1 should not have duplicate categories due to capitalization
tab iunique1
foreach var of varlist iunique1{
replace iunique1 = lower(`var')
}
tab iunique1

*iunique2 should not have duplicate categories due to capitalization
tab iunique2
foreach var of varlist iunique2{
replace iunique2 = lower(`var')
}
tab iunique2

*iunique3 should not have duplicate categories due to capitalization
tab iunique3
foreach var of varlist iunique3{
replace iunique3 = lower(`var')
}
tab iunique3

*iunique4 should not have duplicate categories due to capitalization
tab iunique4
foreach var of varlist iunique4{
replace iunique4 = lower(`var')
}
tab iunique4

*iunique5 should not have duplicate categories due to capitalization
tab iunique5
foreach var of varlist iunique5{
replace iunique5 = lower(`var')
}
tab iunique5

*iunique6 should not have duplicate categories due to capitalization
tab iunique6
foreach var of varlist iunique6{
replace iunique6 = lower(`var')
}
tab iunique6

*iunique7 should not have duplicate categories due to capitalization
tab iunique7
foreach var of varlist iunique7{
replace iunique7 = lower(`var')
}
tab iunique7
************************************************************************************




************************************************************************************
***look for treatment effects for each identity category
gen identstr = ""

*Religion, morality, and philosophy
count if iunique1 == "religion, morality, and philosophy" | iunique2 == "religion, morality, and philosophy" | iunique3 == "religion, morality, and philosophy" | iunique4 == "religion, morality, and philosophy" | iunique5 == "religion, morality, and philosophy" | iunique6 == "religion, morality, and philosophy" | iunique7 == "religion, morality, and philosophy"

count if (iunique1 == "religion, morality, and philosophy" | iunique2 == "religion, morality, and philosophy" | iunique3 == "religion, morality, and philosophy" | iunique4 == "religion, morality, and philosophy" | iunique5 == "religion, morality, and philosophy" | iunique6 == "religion, morality, and philosophy" | iunique7 == "religion, morality, and philosophy") & treatR == "T" 
//139
count if (iunique1 == "religion, morality, and philosophy" | iunique2 == "religion, morality, and philosophy" | iunique3 == "religion, morality, and philosophy" | iunique4 == "religion, morality, and philosophy" | iunique5 == "religion, morality, and philosophy" | iunique6 == "religion, morality, and philosophy" | iunique7 == "religion, morality, and philosophy") & treatR == "C"
//108
count if iunique1 ~= "" & treatR == "T" //697

di 139/697 //.199

count if iunique1 ~= "" & treatR == "C" //604

di 108/604 //.179

prtesti 697 .199 604 .179
